/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fgv.erp.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author adao
 */
@Entity
@Table(name = "Corretor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Corretor.findAll", query = "SELECT c FROM Corretor c"),
    @NamedQuery(name = "Corretor.findByCorretor", query = "SELECT c FROM Corretor c WHERE c.corretor = :corretor"),
    @NamedQuery(name = "Corretor.findByAdministrador", query = "SELECT c FROM Corretor c WHERE c.administrador = :administrador"),
    @NamedQuery(name = "Corretor.findByAtivo", query = "SELECT c FROM Corretor c WHERE c.ativo = :ativo"),
    @NamedQuery(name = "Corretor.findByDataInclussao", query = "SELECT c FROM Corretor c WHERE c.dataInclussao = :dataInclussao"),
    @NamedQuery(name = "Corretor.findByEmail", query = "SELECT c FROM Corretor c WHERE c.email = :email"),
    @NamedQuery(name = "Corretor.findByFoneCelular", query = "SELECT c FROM Corretor c WHERE c.foneCelular = :foneCelular"),
    @NamedQuery(name = "Corretor.findByFoneResidencial", query = "SELECT c FROM Corretor c WHERE c.foneResidencial = :foneResidencial"),
    @NamedQuery(name = "Corretor.findByNome", query = "SELECT c FROM Corretor c WHERE c.nome = :nome"),
    @NamedQuery(name = "Corretor.findBySenha", query = "SELECT c FROM Corretor c WHERE c.senha = :senha")})
public class Corretor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "corretor")
    private Long corretor;
    @Column(name = "administrador")
    private Boolean administrador;
    @Column(name = "ativo")
    private Boolean ativo;
    @Column(name = "dataInclussao")
    @Temporal(TemporalType.DATE)
    private Date dataInclussao;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="E-mail inválido")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 255)
    @Column(name = "email")
    private String email;
    @Lob
    @Size(max = 65535)
    @Column(name = "endereco")
    private String endereco;
    @Size(max = 255)
    @Column(name = "foneCelular")
    private String foneCelular;
    @Size(max = 255)
    @Column(name = "foneResidencial")
    private String foneResidencial;
    @Lob
    @Size(max = 65535)
    @Column(name = "informacoesComplementares")
    private String informacoesComplementares;
    @Size(max = 255)
    @Column(name = "nome")
    private String nome;
    @Size(max = 255)
    @Column(name = "senha")
    private String senha;

    public Corretor() {
    }

    public Corretor(Long corretor) {
        this.corretor = corretor;
    }

    public Long getCorretor() {
        return corretor;
    }

    public void setCorretor(Long corretor) {
        this.corretor = corretor;
    }

    public Boolean getAdministrador() {
        return administrador;
    }

    public void setAdministrador(Boolean administrador) {
        this.administrador = administrador;
    }

    public Boolean getAtivo() {
        return ativo;
    }

    public void setAtivo(Boolean ativo) {
        this.ativo = ativo;
    }

    public Date getDataInclussao() {
        return dataInclussao;
    }

    public void setDataInclussao(Date dataInclussao) {
        this.dataInclussao = dataInclussao;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEndereco() {
        return endereco;
    }

    public void setEndereco(String endereco) {
        this.endereco = endereco;
    }

    public String getFoneCelular() {
        return foneCelular;
    }

    public void setFoneCelular(String foneCelular) {
        this.foneCelular = foneCelular;
    }

    public String getFoneResidencial() {
        return foneResidencial;
    }

    public void setFoneResidencial(String foneResidencial) {
        this.foneResidencial = foneResidencial;
    }

    public String getInformacoesComplementares() {
        return informacoesComplementares;
    }

    public void setInformacoesComplementares(String informacoesComplementares) {
        this.informacoesComplementares = informacoesComplementares;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (corretor != null ? corretor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Corretor)) {
            return false;
        }
        Corretor other = (Corretor) object;
        if ((this.corretor == null && other.corretor != null) || (this.corretor != null && !this.corretor.equals(other.corretor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.fgv.erp.modelo.Corretor[ corretor=" + corretor + " ]";
    }
    
}
